<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:68:"D:\wamp\www\LunTan\public/../application/admin\view\login\index.html";i:1553863929;s:60:"D:\wamp\www\LunTan\application\admin\view\public\header.html";i:1553863929;s:60:"D:\wamp\www\LunTan\application\admin\view\public\footer.html";i:1553863929;}*/ ?>

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">

    <title>H+ 后台主题UI框架 - 主页</title>

    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->

    <link rel="shortcut icon" href="/static/admin/favicon.ico"> <link href="/static/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/static/admin/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="/static/admin/css/animate.css" rel="stylesheet">
    <link href="/static/admin/css/style.css?v=4.1.0" rel="stylesheet">
</head>

<body class="gray-bg">

<div class="middle-box text-center loginscreen  animated fadeInDown">
    <div>
        <div>

            <h1 class="logo-name">H+</h1>

        </div>
        <h3>欢迎使用 H+</h3>

        <form class="m-t" id="dataForm" role="form" action="<?php echo url('admin/login/index'); ?>" method="POST">
            <div class="form-group">
                <input type="text" class="form-control" name="name" placeholder="用户名" >
            </div>
            <div class="form-group">
                <input type="password" class="form-control" name="password" placeholder="密码" >
            </div>


             <div id="wait" class="alert alert-warning alert-dismissible show" style="padding: 8px;margin-bottom: 10px;">
            正在加载验证码...
        </div>
            <div class="row">
                <div class="col-xs-12">
                    <div class="form-group">
                        <div id="embed-captcha"></div>
                    </div>
                </div>
            </div>
            <label class="pull-left">
                <input type="checkbox" name="remember" value="1" class="i-checks">记住我
            </label>

            <button type="button" class="btn btn-primary block full-width m-b" id="login_button">登 录</button>



        </form>
    </div>
</div>
</body>
<!-- 全局js -->
<script src="/static/admin/js/jquery.min.js?v=2.1.4"></script>
<script src="/static/admin/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/static/admin/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/static/admin/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="/static/admin/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>

<script src="/static/admin/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/static/admin/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="/static/admin/js/plugins/layer/laydate/laydate.js"></script>
<script src="/static/admin/js/plugins/layer/layer.min.js"></script>
<script src="/static/admin/geetest/gt.js"></script>
<script src="/static/common.js"></script>
<!-- 自定义js -->
<script src="/static/admin/js/hplus.js?v=4.1.0"></script>
<script type="text/javascript" src="/static/admin/js/contabs.js"></script>

<!-- 第三方插件 -->
<script src="/static/admin/js/plugins/pace/pace.min.js"></script>


<script>

    $(function () {
        layer.msg('请先完成验证', {
            icon: 2
        });
        $("#user_name").focus();
    });

    var handlerEmbed = function (captchaObj) {

        $("#login_button").click(function (e) {

            var validate = captchaObj.getValidate();
            if (!validate) {
                layer.msg('请先完成验证', {
                    icon: 2
                });
                e.preventDefault();
            }
        });

        captchaObj.appendTo("#embed-captcha");
        captchaObj.onReady(function () {
            $("#login_button").attr("disabled", false);
            $("#wait")[0].className = "hide";
        });
        // 更多接口参考：http://www.geetest.com/install/sections/idx-client-sdk.html
    };
    $.ajax({
        url: "<?php echo url('get_geetest_status'); ?>",
        type: "post",
        dataType: "json",
        success: function (data) {
            console.log(data);
            initGeetest({
                gt: data.gt,
                challenge: data.challenge,
                new_captcha: data.new_captcha,
                product: "embed",
                offline: !data.success
            }, handlerEmbed);
        }
    });
</script>
<script>
    $('#login_button').click(function () {

        var loadT = layer.msg('正在提交，请稍候…', {icon: 16, time: 0, shade: [0.3, "#000"]});
        var form_action = $('#dataForm').attr('action');
        var form_method = $('#dataForm').attr('method');
        var form_data = $('#dataForm').serialize();
        console.log(form_data)
        console.log('%cajax submit start!', ';color:#333333');
        console.log('action:' + form_action);
        console.log('method:' + form_method);
        console.log('data:' + form_data);
        $.ajax({
                url: form_action,
                dataType: 'json',
                type: form_method,
                data: form_data,
//                contentType: false,
//                processData: false,
                success: function (result) {
                    layer.close(loadT);
                    layer.msg(result.msg,{
                        icon: result.code ? 1 : 2
                    });
                    console.log('submit success!');
                    if (result.code === 1) {
                        location.href =  result.url;
                    } else {
                        console.log('%cresult fail', ';color:#f39c12');
                    }
                },
                error: function (xhr, type, errorThrown) {
                    //异常处理；
                    console.log('%csubmit fail!', ';color:#dd4b39');
                    console.log();
                    console.log("type:" + type + ",readyState:" + xhr.readyState + ",status:" + xhr.status);
                    console.log("url:" + form_action);
                    console.log("data:" + form_data);
                    layer.close(loadT);
                    layer.msg('访问错误,代码'+xhr.status,{icon:2});
                }
            }
        );
    })
</script>
</html>
